<template>
    <div class="grid-content">
        <div class="content-header drag-handle">
            <slot class="name" name="title">留言板</slot>
            <slot name="action">
                <div class="action">
                    <el-popover placement="top-start" width="120" trigger="hover">
                        <div class="btn-group">
                            <div>刷新</div>
                        </div>
                        <i class="el-icon-more" slot="reference"></i>
                    </el-popover>
                </div>
            </slot>
        </div>
        <div class="component-box">
            <slot name="body"></slot>
        </div>
        <slot name="footer"></slot>
    </div>
</template>
<script>
    export default {
        props: {
            height: {
                type: [String, Number],
                default: '200px'
            },
            width: {
                type: [String, Number],
                default: '25%'
            }
        },
        data() {
            return {

            }
        }
    }
</script>
<style scoped>
    .grid-content {
        /* background: rgba(0, 0, 0, .2); */
        background: #fff;
        border-radius: 4px;
        /* min-height: 400px; */
        overflow: hidden;
    }

    .component-box {
        min-height: 200px;
    }

    .content-header {
        height: 20px;
        display: flex;
        flex-wrap: nowrap;
        justify-content: space-between;
        padding: 15px;
        border-bottom: 1px solid #eaeaea;
        cursor: move;
        user-select: none;

    }

    .content-header>div {
        height: 20px;
        font-size: 14px;
        line-height: 20px;
        user-select: auto;
        cursor: pointer;
    }

    .content-body {
        box-sizing: border-box;
        padding: 15px;
        min-height: 350px;
        /* height: calc(100% - 51px); */
        overflow-y: auto;
        /*  */
    }

    .content-body::-webkit-scrollbar {
        /*滚动条整体样式*/
        width: 10px;
        /*高宽分别对应横竖滚动条的尺寸*/
        height: 1px;
    }

    .content-body::-webkit-scrollbar-thumb {
        /*滚动条里面小方块*/
        border-radius: 10px;
        -webkit-box-shadow: inset 0 0 5px rgba(184, 184, 184, 0.1);
        background: #c0c0c0;
    }

    .content-body::-webkit-scrollbar-track {
        /*滚动条里面轨道*/
        -webkit-box-shadow: inset 0 0 5px rgba(49, 49, 49, 0.1);
        border-radius: 10px;
        background: #EDEDED;
    }

    .name {
        font-weight: bold;
        color: #6c757d;
        font-size: 12px;
    }

    .action {
        font-size: 10px;
        color: #6c757d;
    }

    .btn-group>div {
        padding: 5px 10px;
        height: 25px;
        line-height: 25px;
        font-size: 14px;
        color: #6c757d;
        cursor: pointer;
    }

    .btn-group>div:hover {
        background: rgba(233, 233, 233, 0.35);
    }
</style>